package com.learn.spring.java_config;

import com.learn.spring.bean.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;

/**
 * @author wangxing
 * @version 2020/6/12 12:04 Administrator
 */
@Configuration
public class MainScopeConfig {
    @Bean(name = "person")
    @Scope(value = "prototype")
    //singleton  单实例的(默认),prototype 多实例的, request  同一次请求, session  同一个会话级别
    public Person getPerson() {
        return new Person();
    }

}
